import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;

public class Test {

    public static void main4(String[] args) {
        BigDecimal num1 = new BigDecimal("1.35");
        BigDecimal num2 = new BigDecimal("3.22");
        BigDecimal divide1 = num1.divide(num2,4, RoundingMode.HALF_UP);
        BigDecimal divide2 = num1.divide(num2,2, RoundingMode.HALF_UP);
        System.out.println(divide1);
        System.out.println(divide2);


        BigDecimal divRet = num1.divide(num2, new MathContext(2));
        System.out.println(divRet);
    }

    public static void main3(String[] args) {
        System.out.println(0.1 + 0.2);
        BigDecimal a = new BigDecimal("0.1");
        BigDecimal b = new BigDecimal("0.2");
        System.out.println(a.add(b));
    }

    public static void main2(String[] args) {
        BigDecimal num1 = new BigDecimal("1.35");
        BigDecimal num2 = new BigDecimal("3.22");

        BigDecimal addRet = num1.add(num2);

        BigDecimal subtractRet = num1.subtract(num2);

        BigDecimal multiplyRet = num1.multiply(num2);


        System.out.println(addRet);

        System.out.println(subtractRet);

        System.out.println(multiplyRet);
    }
    private static void testMethod(){

        System.out.println("testMethod");

    }

    public static void main1(String[] args) {

        /*BigDecimal doubleNum = new BigDecimal(9223372036854775807L);
        System.out.println( doubleNum);*/

        BigDecimal num1 = new BigDecimal("92233720368547758078");

        BigDecimal num2 = new BigDecimal("1");

        BigDecimal ret = num1.add(num2);

        System.out.println(ret);
    }
}
